# -*- coding: utf8 -*-

from pymagnolia import *

DEBUG=False

api = MagnoliaApi('65205c35a073de6f4083ed289a15adfc81041959')

bookmarks = api.bookmarks_find(person='myself', limit=6)

for bm in bookmarks :
  tag_str = ", ".join(bm['tags'])
  print '''            <div class="page">
             <div class="page_left">
              <div class="date">%s/%s/%s</div>
              %s
             </div>
             <div class="page_right">
              <div class="title"><a href="%s">%s</a> <a href="javascript:alert('チェインに追加');"><img src="static/images/wave.gif" width="10px" height="10px" title="('Add to Chain')" /></a></div>
             </div>
            </div>''' % (bm['created'][0:4],bm['created'][5:7],bm['created'][8:10], tag_str, bm['url'], bm['title'], )
